package com.onlinescxhz.demo.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 同意返回结果
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
       private String code;
       private String msg;
       private Object data;
       private String token;

       public static Result seccess(String token) {
              return new Result("200","",null,token);
       }
       public static Result seccess() {
              return new Result("200","",null,null);
       }
       public static Result seccess(Object data) {
              return new Result("200","",data,"");
       }
       public static Result seccess(Object data,String token) {
              return new Result("200","",data,token);
       }
       public static Result error() {
              return new Result("500","",null,"");
       }
       public static Result error(String msg) {
              return new Result("500",msg,null,"");
       }


}
